package com.yogurt.edu.client;

import com.yogurt.utils.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Auther: 酸奶
 * @Date: 2020/08/27 16:47
 * @Description: 远程调用service_vod中删除视频的方法的接口
 */
// @FeignClient("service-vod")
@FeignClient(name = "service-vod",fallback = VodClientImpl.class) //当调用失败时,会执行VodClientImpl中的对应方法
@Component
public interface VodClient {

    //根据视频id删除阿里云的视频(单个删除)
    //路径写全
    //@PathVariable("id")一定要指定参数
    @DeleteMapping("/eduvod/video/deleteVideo/{id}")
    public Result deleteVideo(@PathVariable("id") String id);

    //批量删除阿里云的视频
    //根据视频id删除阿里云中的视频(批量删除)
    @DeleteMapping("/eduvod/video/deleteBatchVideo")
    public Result deleteBatchVideo(@RequestParam("ids") List<String> ids);
}
